import urllib2
import simplejson
import sys

url = ('https://ajax.googleapis.com/ajax/services/search/images?' +
       'v=1.0&q=' + sys.argv[1])

request = urllib2.Request(url, None, {'Referer': "www.tamer.com"})
response = urllib2.urlopen(request)

# Process the JSON string.
results = simplejson.load(response)
# now have some fun with the results...
print(results.get('responseData').get('results').pop().get('url'))
